<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	template="/template/LayoutCliente.xhtml">


	<f:metadata>
		<f:viewAction action="#{tarefaController.buscarTodasTarefa}" />
	</f:metadata>


	<ui:define name="content">
	
	<f:metadata>
		<f:event type="preRenderView" listener="#{loginController.testeSessaoCliente}"/> 
	</f:metadata>
	
	<p:panel id="prjHeader" header="Projeto: #{projetoController.projetoSelecionado.nome}">
			<h:form id="adm" style="text-align:center;">
				<p:commandLink id="dadosPrj"  style="margin-right:100px" value="Dados do Projeto" action="#{loginController.redirectDadosProjeto}"/>
				<p:outputLabel id="backlog"	style="margin-right:100px;color:blue;font-weight:bold;" value="Backlog" />
				<p:commandLink id="taskboard"	style="margin-right:100px" value="TaskBoard" action="#{loginController.redirectTaskBoard}"/>
				<p:commandLink id="burndown"  	style="margin-right:100px" value="BurnDown Chart" action="#{loginController.redirectBurnDown}"/>
			</h:form>
	</p:panel>

				<p:fieldset legend="Tarefas do Projeto" style="text-align:center">

					<h:form id="formListaRequisitos">

						<p:dataGrid var="tarefa"
							value="#{tarefaController.tarefaPorProjeto}" columns="3"
							rows="3" paginator="true"
							paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
							rowsPerPageTemplate="3,6,9">

							<p:panel header="#{tarefa.nome}" style="text-align:center" class="postit">


								<h:panelGrid columns="1" style="width:100%">

									<p:commandButton update=":dialog"
										icon="ui-icon-plus" title="View"
										oncomplete="PF('dlgDadostarefa').show();">
										<f:setPropertyActionListener value="#{tarefa}"
											target="#{tarefaController.tarefaSelecionada}" />
									</p:commandButton>

									<p:growl id="grow" showDetail="true" />

								</h:panelGrid>
							</p:panel>

						</p:dataGrid>
					</h:form>
					<p:dialog id="dialog" widgetVar="dlgDadostarefa" showEffect="clip"
						hideEffect="clip" modal="true" appendTo="@(body)" width="400"
						height="230" class="postit">

						<h:form id="formDialog">
							<p:outputPanel id="detail" style="text-align:center;"
								layout="block">

								<h:panelGrid columns="2" cellpadding="5">

									<h:outputText value="Nome: " />
									<p:outputLabel id="trfNome"
										value="#{tarefaController.tarefaSelecionada.nome}" />

									<h:outputLabel value="Desenvolvedor" />
									<p:outputLabel
										value="#{tarefaController.tarefaSelecionada.desenvolvedor.nome}" />

									<h:outputText value="Prioridade:" />
									<p:rating
										value="#{tarefaController.tarefaSelecionada.prioridade}"
										readonly="true" />

									<h:outputText value="Dificuldade:" />
									<p:outputLabel id="txtDificuldade"
										value="#{tarefaController.tarefaSelecionada.dificuldade}" />

									<h:outputLabel for="txtTempo_ex" value="Tempo de Execução: " />
									<p:outputLabel id="txtTempo_ex" value="Horas: ">
										#{tarefaController.tarefaSelecionada.tempo_execucao}
									</p:outputLabel>
								</h:panelGrid>
							</p:outputPanel>
						</h:form>
					</p:dialog>
				</p:fieldset>
	</ui:define>
</ui:composition>